package com.itheima.dao;

import com.itheima.User;
import com.itheima.utils.Insert;
import com.itheima.utils.Select;
import com.itheima.utils.Update;

import java.util.List;

public interface UserDao {

    @Insert("insert into user (username,birthday,sex,address) values(#{username},#{birthday},#{sex},#{address})")
    public void add(User user);

    @Update("update user set username=#{username},birthday=#{birthday},sex=#{sex},address=#{address} where id=#{id}")
    public void update(User user);

    @Select("SELECT * from user where id=#{id}")
    public User findPersonByid(Long id);

    @Select("SELECT * from user")
    public List<User> findAll();
}
